﻿// SafeArray.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。
//

#include <iostream>
#include "SafeArray.h"
int main()
{
	SafeArray<int, 10> array;
	for (int i = 0; i <= 10; i++)
	{
		try
		{
			array[i] = i;
			std::cout << "array[ " << i << " ] = " << array[i] << std::endl;
		}
		catch (const std::out_of_range & err)
		{
			std::cerr << "array[ " << i << " ]  " << "Out of Range error: " << err.what() << '\n';
			break;
		}
	}

	array.Print();
	return 0;
}